/*
 * @Author: pengyong
 * @Date: 2021-03-12 20:44:25
 * @LastEditors: pengyong
 * @LastEditTime: 2021-03-22 21:05:34
 * @Description:
 * @FilePath: /supplier_app/screens/MeScreen.js
 */
import React, {Component} from 'react';
import {StyleSheet, ScrollView, View, Text, StatusBar} from 'react-native';
import {Button} from 'react-native-elements';
import {Actions} from 'react-native-router-flux';
import AsyncStorage from '@react-native-community/async-storage';

import Api from '../Api';
import ListItem from '../components/ListItem';
import MeInfo from '../assets/me_info.png';
import MePassword from '../assets/me_password.png';
import MeMobile from '../assets/me_mobile.png';

export default class MeScreen extends Component {
  render() {
    return (
      <ScrollView
        style={{
          height: '100%',
        }}>
        <StatusBar barStyle="light-content" backgroundColor="#5096fc" />
        <ListItem
          title="个人信息"
          icon={MeInfo}
          iconStyle={{width: 24, height: 21}}
          showBadge={false}
          onPress={() => {
            Actions.userInfoScreen();
          }}
          style={{marginTop: 15}}
        />
        <ListItem
          title="修改密码"
          icon={MePassword}
          iconStyle={{width: 24, height: 24}}
          showBadge={false}
          onPress={() => {
            Actions.changePasswordScreen();
          }}
        />
        <ListItem
          title="换绑手机"
          icon={MeMobile}
          iconStyle={{width: 23, height: 24}}
          showBadge={false}
          onPress={() => {
            Actions.changeMobile();
          }}
        />
        <View style={styles.submitBot}>
          <Button
            title="退出登录"
            buttonStyle={styles.logout}
            titleStyle={{fontSize: 15}}
            onPress={() => {
              Api.logout();
            }}
          />
        </View>
      </ScrollView>
    );
  }
}

const styles = StyleSheet.create({
  submitBot: {
    paddingVertical: 8,
    marginHorizontal: 15,
  },
  logout: {
    height: 40,
    backgroundColor: '#5096fc',
    marginTop: 95,
  },
});
